Skip to content

feat: add @supabase/middleware regression eval - #273

Merged
mandarini merged 3 commits into
mainfrom
feat/middleware-regression-eval
Sep 10, 2026
Merged

feat: add @supabase/middleware regression eval#273
mandarini merged 3 commits into
mainfrom
feat/middleware-regression-eval

Conversation

@mandarini

@mandarini mandarini commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Adds a regression eval for @supabase/middleware (https://github.com/supabase/middleware), the sibling of the @supabase/server pair: the prompt names the package and asks for an Edge Function that composes the built-in CORS middleware with a hand-written defineMiddleware API-key gate. The scorer drives the key gate through the local gateway (no key and wrong key both 401, right key 200 with the key id read from ctx), checks Vary: Origin as the CORS signal, and gates on the source importing the package and calling defineMiddleware.

Two details worth knowing: the local Kong answers preflights and rewrites Access-Control-Allow-Origin to * on /functions/v1/*, so Vary: Origin is the only CORS behavior observable through it; and the seeded functions/.env needed a .gitignore exception, following the existing one. Refreshed results are included: 6 of 6 runs pass (three with skills, three without), the expected baseline for a usability canary.

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
evals Ready Ready Preview Sep 10, 2026 8:42am UTC

Request Review

@mandarini mandarini added the run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes label Sep 8, 2026
@mandarini mandarini self-assigned this Sep 8, 2026
@mandarini mandarini removed the run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes label Sep 8, 2026
@mandarini
mandarini marked this pull request as ready for review September 8, 2026 12:18
@mandarini
mandarini requested a review from a team September 8, 2026 12:18

@barryroodt barryroodt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One scorer issue to fix before merge: the prompt permits defining the API-key middleware in a helper module, but the index-only source check rejects that valid layout. This fails the whole eval even when all HTTP checks pass. Could we inspect imported local modules before rejecting the implementation?

Comment thread evals/build-functions-007-cors-api-key-with-middleware/EVAL.ts Outdated
@mandarini
mandarini force-pushed the feat/middleware-regression-eval branch from d148dd0 to 24112be Compare September 10, 2026 08:25
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mandarini mandarini added run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes and removed run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes labels Sep 10, 2026
@mandarini
mandarini merged commit 7543f66 into main Sep 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants